package com.xinsoft.service.impl;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xinsoft.entity.dto.CusPatrolStandardParam;
import com.xinsoft.entity.po.CusPatrolStandard;
import com.xinsoft.mapper.CusPatrolStandardMapper;
import com.xinsoft.service.CusPatrolStandardService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
* @author lijie
* @description 针对表【cus_patrol_standard(巡检标准表)】的数据库操作Service实现
* @createDate 2023-06-20 09:50:39
*/
@Service
public class CusPatrolStandardServiceImpl extends ServiceImpl<CusPatrolStandardMapper, CusPatrolStandard>
    implements CusPatrolStandardService{

    @Resource
    CusPatrolStandardMapper standardMapper;

    @Override
    public Object findPageListByParam(CusPatrolStandardParam param) {
        //分页
        Page<CusPatrolStandard> page = new Page<CusPatrolStandard>(param.getCurrentPage(), param.getPageSize());
        LambdaQueryWrapper<CusPatrolStandard> queryWrapper = new LambdaQueryWrapper<>();
        //查询条件
        queryWrapper
                .like(StrUtil.isNotBlank(param.getStandardName()),CusPatrolStandard::getStandardName,param.getStandardName());
        IPage<CusPatrolStandard> resultPage = standardMapper.selectPage(page, queryWrapper);
        //返回值
        return resultPage;
    }
}




